Tryit Editor v2.3

Edit This Code:
<html> <body> <p>Click the button to display a message based on what day it is today:</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var text; switch (new Date().getDay()) { case 6: text = "Today is Saturday"; break; case 0: text = "Today is Sunday"; break; default: text = "Looking forward to the Weekend"; } document.getElementById("demo").innerHTML = text; } </script> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_switch2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:35:59 GMT --> </html>
Result:
Try it Yourself - © w3schools.com